home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
batchut
/
bcsrce2.zip
/
#.BC
next >
Wrap
Text File
|
1990-03-05
|
2KB
|
79 lines
echo off
let %!a = %1
if %!a@ = @ goto MENU
if "%!a" = "+" gosub PLUS
if "%!a" = "-" gosub SUBT
if "%!a" = "/" gosub DIVI
if "%!a" = "*" gosub MULT
if "%!a" = "\" gosub MODU
if %!a = ADD gosub PLUS
if %!a = SUBTRACT gosub SUBT
if %!a = DIVIDE gosub DIVI
if %!a = MULTIPLY gosub MULT
if %!a = MODULUS gosub MODU
goto END
:PLUS
let %!b = %2
if %!b@ = @ goto MENU
let %!c = %3
if %!c@ = @ goto MENU
add %!b %!c
!echo %!b
return
:DIVI
let %!b = %2
if %!b@ = @ goto MENU
let %!c = %3
if %!c@ = @ goto MENU
div %!b %!c
!echo %!b
return
:MODU
let %!b = %2
if %!b@ = @ goto MENU
let %!c = %3
if %!c@ = @ goto MENU
mod %!b %!c
!echo %!b
return
:MULT
let %!b = %2
if %!b@ = @ goto MENU
let %!c = %3
if %!c@ = @ goto MENU
mul %!b %!c
!echo %!b
return
:SUBT
let %!b = %2
if %!b@ = @ goto MENU
let %!c = %3
if %!c@ = @ goto MENU
sub %!b %!c
!echo %!b
return
:MENU
echo ══════════════════════════════════════════════════════════════════════════
echo MENU---: MATH ADD #1 #2 [Integers only]
echo EXAMPLE--: ADD 2345 678 {returns 3023}
echo NOTE-----: + #1 #2 {can be used in place of ADD}
echo ══════════════════════════════════════════════════════════════════════════
echo MENU---: MATH SUBTRACT #1 #2 [Integers only]
echo EXAMPLE--: SUBTRACT 2345 678 {returns 1667}
echo NOTE-----: - #1 #2 {can be used in place of SUBTRACT}
echo ══════════════════════════════════════════════════════════════════════════
echo MENU---: MATH DIVIDE #1 #2 [Integers only]
echo EXAMPLE--: DIVIDE 25 5 {returns 5}
echo NOTE-----: / #1 #2 {can be used in place of DIVIDE}
echo ══════════════════════════════════════════════════════════════════════════
echo MENU---: MATH MODULUS #1 #2 [Integers only]
echo EXAMPLE--: MODULUS 30 7 {returns 2} [hint 2=(30-(7*4)]
echo NOTE-----: \ #1 #2 {can be used in place of MODULUS}
echo ══════════════════════════════════════════════════════════════════════════
echo MENU---: MATH MULTIPLY #1 #2 [Integers only]
echo EXAMPLE--: MULTIPLY 23 67 {returns 1541}
echo NOTE-----: * #1 #2 {can be used in place of MULITPLY}
echo ▒ Tip: RENAME MATH.EXE #.EXE ▒
goto END
:END